function res = Mat1(N,x_max)
h = x_max/N;
res = zeros(N,N); 
res(1,N) = -1;
res(1,2) = 1;
for i = 2:N-1
    res(i,i-1) = -1;
    res(i,i+1) = 1;
end
res(N,N-1) = -1;
res(N,1) = 1;
res = res/(2*h);